'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class loginLog extends Model {
    static associate(models) {
      // define association here
    }
  };
  loginLog.init({
    id: {
      allowNull: false,
      autoIncrement: true,
      primaryKey: true,
      type: Sequelize.INTEGER,
      comment: 'id'
    },
    user_id: {
      type: Sequelize.INTEGER,
      allowNull: false,
      defaultValue: 0,
      comment: '用户id'
    },
    login_ip_at: {
      type: Sequelize.CHAR(15),
      allowNull: false,
      field: 'login_ip_at',
      defaultValue: '',
      comment: '用户登录的ip地址'
    },
    login_at: {
      allowNull: false,
      type: Sequelize.DATE,
      filed: 'login_at',
      comment: '用户登录的时间'
    }
  }, {
    sequelize,
    modelName: 'login-log',
    tableName: 'login-log'
  });
  return loginLog;
};